package com.Lyf.order.controller;


import com.Lyf.order.feign.StockFeign;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping(value = "/order")
public class OrderController {

    @Autowired
    StockFeign stockFeign;

    @GetMapping("/order_test")
    public String orderTest()
    {
        return "hello order";
    }

    @GetMapping("/order_test1")
    public String orderTest1()
    {
        System.out.println("进入");
        stockFeign.test();
        return "hello order";
    }

    //测试路径收参
    @GetMapping("/order_buy/{count}")
    public String orderBuy(@PathVariable("count") Integer count)
    {
        System.out.println("接收到的参数值为："+count);
        stockFeign.cutStock(count);
        System.out.println("调用了order接口");
        return "/";
    }

}
